package day5.chongwu;

/**
 * @author oldliu
 * @since 1.0
 */
public class Pet {
    protected String name;
     int love;
    private int health;

    public Pet() {
    }

    public Pet(int love, int health) {
        this.love = love;
        this.health = health;
    }

    public Pet(String name, int love, int health) {
        this.name = name;
        this.love = love;
        this.health = health;
    }

    public void show() {
        System.out.println("名字叫" + name + "，健康值是：" + health + ",可爱程度：" + love);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    @Override
    public String toString() {
        System.out.println("调用了tostring-----");
        return "名字叫"+this.name+"，健康值是"+this.health+",可爱程度"+this.love;
    }
}
